﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace webPage
{
    public partial class Page : UserControl
    {

        private double width;
        private double gheigth;
        private int super;
        private string user;
        private string pass;
        
        public Page()
        {
            InitializeComponent();
            width = 100;
            gheigth = 70;
            super = 0;
            user = "";
            pass = "";
        }

        //Botoes do cinema

        private void cinema_Click(object sender, RoutedEventArgs e)
        {
            //Terminar outras animações
            cinemaPanel1.Stop();
            gestaoPanel1.Stop();
            //iniciar a sua
            cinemaPanel1.Begin();

        }

        private void coCinema_Click(object sender, RoutedEventArgs e)
        {
            cinemaPanel1.Stop();
        }

        private void coFilmes_Click(object sender, RoutedEventArgs e)
        {
            cinemaPanel1.Stop();
            super = 1;
        }

        //botoes de gestao

        private void gestao_Click(object sender, RoutedEventArgs e)
        {
            //Terminar outras animações
            cinemaPanel1.Stop();
            gestaoPanel1.Stop();
            //Colocar diferente para superUser
            /*if (super == 0)
            {
                width = 0;
                gheigth = 70;
            }
            else
            {
                width = 100;
                gheigth = 150;
            }
            gestaoPanel.Height = gheigth;
            gPremio.Width = width;*/
            //iniciar a sua
            gestaoPanel1.Begin();
        }

        private void gPremio_Click(object sender, RoutedEventArgs e)
        {
            gestaoPanel1.Stop();
        }

        private void gConta_Click(object sender, RoutedEventArgs e)
        {
            gestaoPanel1.Stop();
        }
        //Botoes estatisticas
        private void estatisticas_Click(object sender, RoutedEventArgs e)
        {
            cinemaPanel1.Stop();
            gestaoPanel1.Stop();
            estatisticasPanel1.Stop();
            estatisticasPanel1.Begin();
        }
        //Botoes about
        private void about_Click(object sender, RoutedEventArgs e)
        {
            cinemaPanel1.Stop();
            gestaoPanel1.Stop();
        }

        //Secção de Login

        private void login1_Click(object sender, RoutedEventArgs e)
        {
            user = username.Text;
            pass = password.Text;
            if (user.Equals("username") || pass.Equals("**********"))
            {
                aviso.Text = "Insira credenciais correctas";
            }
            else
            {
                password.Text = "";
                aviso.Text = "Bem vindo: "+user; 
            }
        }

        private void recuPass_Click(object sender, RoutedEventArgs e)
        {

        }

        private void registar_Click(object sender, RoutedEventArgs e)
        {

        }


    }
}
